﻿@model HelloMinasan.Web.Song.ViewModels.EditUserModel
@{
    ViewBag.Title = "User Information";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Content/Js/NoteCommands.js")"></script>
<script src="~/Content/Js/CommunityFunction.js"></script>
<script src="../../Scripts/jquery.msgbox.min.js"></script>
<link href="../../Content/jquery.msgbox.css" rel="stylesheet" />
@{ bool isOwner = Model.Username.ToLower() == User.Identity.Name.ToLower() ? true : false;}
<div class="contentSection">
    <div>
        <div style="margin-bottom: 10px;">
            <table width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    <td colspan="2" align="center">
                        <table width="100%" cellspacing="0" cellpadding="0">
                            <tr>
                                <td valign="top" style="width: 520px;">
                                    <div class="contentSection" style="width: 500px; padding: 5px; display: table" align="left">
                                        <div style="display: table;">
                                            <div class="tooltipCSS" style="margin-bottom: 5px;">@Model.UserStatus</div>
                                            <div class="tooltipCSSAfter"></div>
                                        </div>
                                        <img src="@Model.Avatar" class="avatarImg" style="float:left" />
                                        <div class="contentSectionInside titleNewFont fontbold fontsize16px" style="margin-left: 110px;">
                                            <img width="20" src="~/Content/Images/informationIcon.png" />General Information
                                            @if (isOwner)
                                            {
                                                <a style="float:right" href="@Url.Action("EditProfiles", "UserManagement")">
                                                    <div>
                                                        <img src="@Url.Content("~/Content/Images/setting.png")" width="20" height="20"/>
                                                        <span class="titleNewFont" style="font-size: 13px; font-weight: normal">Update</span>
                                                    </div>
                                                </a>
                                            }
                                        </div>
                                        <div class="contentSectionInside" style="margin-left: 110px; border-top: 0;">
                                            <div class="starScore ">@Model.Score</div>
                                            <div>User Id: @Model.UserId</div>
                                            <div>Full name: @Model.Fullname</div>
                                            <div>Date of Birth: @Model.DateOfBirth.ToShortDateString()</div>
                                            <div>Email: @Model.Email</div>
                                            <div>Description: @Model.Descriptions</div>
                                            <div>Last login: @Model.LastAccess.ToShortDateString() at: @Model.LastAccess.ToShortTimeString() </div>
                                        </div>
                                    </div>
                                    <div class="titleNewFont" style="font-size: 28px; font-weight: bold; padding-left: 5px; margin-bottom: 5px;">
                                            My Notes
                                    </div>
                                </td>
                                <td style="padding-top: 5px;" valign="top">
                                    <div style="display: table;">
                                            <div class="tooltipCSS" style="margin-bottom: 5px; width:100%">
                                                @if(Request.IsAuthenticated)
                                                {
                                                    if(!isOwner)
                                                    {
                                                        <a class="iconProfile buttonClass" href="#" style="float:right;" onclick="addFriend('@Model.Username')">
                                                            <div style="display:inline-table">
                                                                <img src="@Url.Content("~/Content/Images/addsmall.png")" width="20" height="20"/>
                                                                <span class="titleNewFont" style="font-size: 11px; font-weight: normal">Follow</span>
                                                            </div>
                                                        </a>
                                                    }
                                                    <a class="iconProfile buttonClass" style="float:right;" href="/UserManagement/MySong/@Model.Username">
                                                        <div style="display:inline-table">
                                                            <img src="@Url.Content("~/Content/Images/song.png")" width="20" height="20"/>
                                                            <span class="titleNewFont" style="font-size: 11px; font-weight: normal">Songs</span>
                                                        </div>
                                                    </a>
                                                }
                                            </div>
                                            <div class="tooltipCSSAfter"></div>
                                        </div>
                                    @if (isOwner)
                                    {
                                        <div>
                                            <textarea class="textAreaComment" style="width: 97% !important; height:117px !important;" id="noteContentId"></textarea>
                                            <div align="right">
                                                <img id="loaderIndicator" src="@Url.Content("~/Content/Images/loader.gif")" /><span id="errorMessage"></span>
                                                <a id="postItCommand" onclick="postNote('@Model.Username')" class="buttonClass">Post it </a>
                                            </div>
                                        </div>
                                    }
                                    else
                                    {
                                        <div align="center" style="line-height:120px;height:120px; color:#ccc;">
                                            Login and return your space to leave a note
                                        </div>
                                    }
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" colspan="2" style="padding-right: 5px;">
                                    <div>
                                        <div style="padding-left: 5px;" id="noteListAjax">
                                            @Html.Action("NotesPartial", "Account", new { username = Model.Username, currentPage = 1 })
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>

